<template>
	<view>
		<header-safearea title="订单"></header-safearea>
		<view class="list-item" v-for="item in listData" :key="item.id">
			<image :src="item.image" mode=""></image>
			<view class="title">{{item.title}}</view>
			<view class="price">{{item.price}}</view>
		</view>

		<button @click="handlePay">支付</button>
	</view>
</template>

<script setup>
	import {
		onLoad
	} from '@dcloudio/uni-app';
	import {
		ref
	} from 'vue';
	const listData = ref([])
	onLoad(options => {
		listData.value = JSON.parse(options.list)
	})

	const handlePay = () => {
		// 支付代码
		wx.requestPayment({
			timeStamp: '',
			nonceStr: '',
			package: '',
			signType: 'MD5',
			paySign: '',
			success(res) {},
			fail(res) {}
		})

		// 进入评价页面
		uni.navigateTo({
			url: '/pages/message/message'
		})
	}
</script>

<style lang="scss" scoped>
.list-item {
	display: flex;
	justify-content: space-around;
	image {
		width: 50rpx;
		height: 50rpx;
	}
}
</style>